<!--
 * @Description: 
 * @version: 
 * @Author: liurui
 * @Date: 2024-02-05 14:10:34
 * @LastEditors: 
 * @LastEditTime: 2024-02-05 14:13:09
-->
<template>
    <div>

    </div>
</template>

<script setup lang="ts">
// 你需要写一个接受数组的类型，并且返回扁平化的数组类型

type Flatten<T extends any[]> = T extends [infer First, ...infer Rest] ? First extends any[] ? [...Flatten<First>, ...Flatten<Rest>] : [First, ...Flatten<Rest>] : [];

type flatten = Flatten<[1, 2, [3, 4], [[[5]]]]>; // [1, 2, 3, 4, 5]

</script>

<style scoped>

</style>